<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>hdcms</div>
    <div>houdunren</div>
    <script>
        //数组检测
        // console.log(Array.isArray([]));
        //new String [].join("") "" + hd 进行连接;
        // let hd = [1, 4, 6, 3].toString();
        // console.log(typeof hd);
        // console.log("" + hd);

        // let str = "baidu.com";
        // console.log(str.split(","))

        // console.log(Array.from(str));
        // 有length 属性可以转成数组
        // let obj = {
        //     0: "hello",
        //     1: "hd",
        //     length: 2
        // }
        // console.log(Array.from(obj));

        let divs = document.querySelectorAll("div");
        console.log(Array.from(divs, function (item) {
            console.log(item.innerHTML);
            item.style.backgroundColor = "red";
            return item;
        }));

    </script>
</body>

</html>